home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_13_11
/
schmidt
/
decldef.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-05
|
1KB
|
36 lines
int a; /* OK in C -- tentative definition.
OK in C++ -- definition. */
int a; /* OK in C -- redeclaration.
Error in C++ -- redefinition. */
int a = 0; /* OK in C -- definition.
Error in C++ -- redefinition. */
extern int b; /* OK in C -- tentative definition.
OK in C++ -- declaration. */
extern int b; /* OK in both -- redeclaration. */
extern int b = 0; /* OK in both -- definition. */
static int c; /* OK in C -- tentative definition.
OK in C++ -- definition. */
static int c; /* OK in C -- redeclaration.
Error in C++ -- redefinition. */
static int c = 0; /* OK in C -- definition.
Error in C++ -- redefinition. */
int const d; /* OK in C -- tentative definition.
Error in C++ -- definition of internally
linked const object must be
initialized. */
void e(int); /* OK in both -- declaration. */
void e(long f) /* Error in C -- definition/declaration
mismatch.
OK in C++ -- overloaded definition. */
{
int g; /* OK in both -- definition. */
int g; /* Error in both -- redefinition */
}